home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM 4
/
Light ROM 4 - Disc 1.iso
/
text
/
maillist
/
1995
/
0295.doc
/
000352_owner-lightwave-l _Fri Feb 17 21:02:48 1995.msg
< prev
next >
Wrap
Internet Message Format
|
1995-03-19
|
9KB
Return-Path: <owner-lightwave-l>
Received: by netcom2.netcom.com (8.6.9/Netcom)
id SAA07315; Fri, 17 Feb 1995 18:50:01 -0800
Received: from bos1b.delphi.com by netcom2.netcom.com (8.6.9/Netcom)
id SAA07293; Fri, 17 Feb 1995 18:49:52 -0800
From: dnakakihara@BIX.com
Received: from bix.com by delphi.com (PMDF V4.3-9 #7804)
id <01HN667L1BC09GVSDW@delphi.com>; Fri, 17 Feb 1995 21:49:50 -0500 (EST)
Received: by bix.com (CoSy3.31.1.50) id <9502172148.memo.52080@BIX.com>; Fri,
17 Feb 1995 21:48:46 -0500 (EST)
Date: Fri, 17 Feb 1995 21:48:46 -0500 (EST)
Subject: LW to VLab Motion ARexx script
To: lightwave-l@netcom.com
Message-id: <9502172148.memo.52080@BIX.com>
MIME-version: 1.0
Content-type: TEXT/PLAIN
Content-transfer-encoding: QUOTED-PRINTABLE
X-CoSy-To: lightwave-l@netcom.com
Sender: owner-lightwave-l@netcom.com
Precedence: bulk
OK, by popular demand, here is my ARexx script that will automaticall=
y
import LW frames into VLab Motion and then delete them. 'Course you c=
ould
adapt it to other uses. In fact, I adapted it from another one I wrot=
e
that moved files over AmigaLink (floppy port) network--much faster
than having LW write the files to the network.
Hope someone finds this useful. As noted in the script header, it
is very important to increase the task priority for VLab Motion.
--Doug
/*
** LW2VLM.rexx
**
** $VER: LW2VLM.rexx 1.0.0 (02.13.95)
**
**
** Waits for LightWave 3D frames to be rendered and then imports them
** to a user-defined VLab-Motion MovieShop scene.
**
** !!!YOU MUST HAVE A PROJECT OPEN!!!
**
** Very rough but useful information about frame rendering time will
** be displayed.
**
** If importing a file fails, the script will sense this and retry an
** unlimited amount of times, so don't worry. This is indicated by
** the Import 'Attempt' information.
**
** See bottom of this script for syntax. Running script with no
** additional information will show syntax. (e.g., RX LW2VLM)
**
** Creates small log file in RAM: called LW2VLM.log
**
** To get this to work properly, you must run MovieShop at a higher
** task priority than LightWave. The easiest way is to run MovieShop
** from the CLI using the following steps:
**
** 1) Open a CLI window.
** 2) Type: "ChangeTaskPri 5" and press Return. (Don't enter=20
** quotes.)
** 3) CD to your MovieShop directory.
** 4) Type: "Run MovieShop" and press Return. (no quotes)
** 5) Open an existing or start a new MovieShop project.
** 6) Now run this script will the appropriate arguments.
**
** There are also utilities available that allow you to change a task
** priority while things are running. If you don't adjust the MovieSh=
op
** task priority higher than LightWave, the LightWave rendering proce=
ss
** will hog the CPU and the files will not be imported on a timely
** basis.
**
** Copyright =A9 1995 Douglas J. Nakakihara
** All rights reserved
**
** Contact author at dnakakihara@bix.com
**
** This script is freely distributable.
*/
Parse arg Basename Scenename Total First Increment
options failat 21
options results
signal on Break_C
/*
** Log filename
*/
LogFN =3D 'ram:LW2VLM.log'
/*
** LightWave numeric extension length. If the extension length is
** ever changed, you only need to change this variable. NOTE: if
** frame numbering exceeds 999 or 9999, script will automatically
** increment this to 4 and 5, respectively.
*/
Extension =3D 3
/*
** Checks for essential arguments
*/
=20
If Basename =3D '' then do
Call Syntax
Exit
End
If Scenename =3D '' then do
Call Syntax
Exit
End
If Total =3D '' then do
Call Syntax
Exit
End
Total =3D strip(Total)
/*
** Sets import parameters. Note if you will be importing fields,
** you will have to change the ImportPicType to 'Field' from=20
** 'Frame'. Also, the size correction has been set to scale. For
** best results, render to the exact size used for your project
** using LightWave's custom size feature.
*/
Address MOVIESHOP
ImportMethod Multipic
ImportPicType Frames
CorrectImportHeight Scale
CorrectImportWidth Scale
/*
** If Scenename already exists, it is made the current scene and
** the dummy frame is made the current frame.
*/
NewScene Scenename
If rc ~=3D 0 then do
Say 'Scenename already exists. Appending to it.'
GoToScene Scenename
End
Address ()
/*
** library necessary for Delay command
*/
Lib=3D'rexxsupport.library'
if ~show('L',Lib) then call addlib(Lib,0,-30,0)
/*
** Extract basename without path
*/
Basename2 =3D Basename
A =3D lastpos("\", Basename2)
If A > 0 then do
Basename2 =3D substr(Basename2, A + 1)
End
A =3D lastpos(":", Basename2)
If A > 0 then do
Basename2 =3D substr(Basename2, A + 1)
End
/*
** Set Increment to 1 if not given
*/
If Increment =3D '' then do
Increment =3D 1
End
Increment =3D strip(Increment)
/*
** Set First to 1 if not given
*/
If First =3D '' then do
First =3D 1
End
First =3D strip(First)
/*
** Write header to log file. Append if file exists
*/
Call OpenLog
Writeln('logfile', '>>>> LW2VLM '||Basename||' '||Scenename,
||' '||Total||' '||First||' '||Increment||' <<<<')
Close('logfile')
/*
** Initialize counter=20
*/
Counter =3D First
Do while Counter <=3D Total
/*
** Initialize various things
*/
=20
Call time('R')
Counter =3D strip(Counter)
If Counter > 999 then Extension =3D 4
If Counter > 9999 then Extension =3D 5
Filename =3D Basename || right(Counter,Extension,'0')
Filename2 =3D Basename2 || right(Counter,Extension,'0')
RC=3D99
Imports =3D 0
Say 'Waiting for ' || Filename || '... (Ctrl-C to abort)'
=20
Do while (RC ~=3D 0)
/*
** Wait for file
*/
=20
Do while ~open('Testing', Filename, 'R')
Call delay(230)
End
Call delay(45)
Close('Testing')
Call delay(200)
/*
** Copy to VLM partition
*/
=20
Imports =3D Imports + 1
Say ' -Importing (Attempt: ' || Imports || ') to ' || Scenename
=20
/*
** Before importing, the script goes to the last frame in the
** scene and then one more over to the dummy frame. This makes
** it so the image is always added to the end of the scene.
*/
Address MOVIESHOP
GoToFrame Last
=09GoToFrame Next
Importframe Filename
Address ()
End
Say ' -Deleting source file'
Address command 'delete >nil: ' || Filename
/*
** Calculate timing information
*/
=20
TESec =3D trunc(time('E')) /* Total Elapsed Seconds */
FPH =3D trunc(3600/TESec, 2) /* Frames Per Hour */
EMin =3D trunc(TESec/60)
ESec =3D trunc(TESec - (EMin * 60))
RendTime =3D EMin||'m ' || ESec || 's'
Say ' -Frame render time: ' || RendTime || ' (Frames/hour: '||FPH||=
')'
FRemain =3D trunc((Total - Counter) / Increment)
Say ' -Frames remaining: ' || FRemain
ERS =3D trunc(FRemain * TESec) /* Est. Remaining Seconds */
ERHrs =3D trunc(ERS/3600)
ERMin =3D trunc((ERS/60) - (ERHrs * 60))
ERSec =3D ERS - (trunc(ERS/60) * 60)
Say ' -Estimated remaining time: '||ERHrs||'h '||ERMin||'m '||ERSec=
||'s'
/*
** Update log file=20
*/
=20
Call OpenLog
Message =3D Filename2||': Import attempts: '||Imports||' Render tim=
e: ',
||RendTime
Writeln('logfile', Message)
Close('logfile')
/*
** Increment frame counter
*/
=20
Counter =3D Counter + Increment
End
Say 'All done!'
Call OpenLog
Writeln('logfile', 'All done!')
Close('logfile')
Exit
Syntax:
Say 'Syntax : LW2VLM <Basename> <Scenename> <Last> <First> <Incr>'
Say ''
Say 'Purpose: Imports rendered files to Scenename as they are rende=
red.'
Say ''
Say ' Basename =3D Filename to look for, excluding numeric'
Say ' extension. Include period, if used (e.g., PIC.)'
Say ' Basename can include path, like RAM:PIC.'
Say ' Scenename =3D MovieShop scene name. Appends if it already ex=
ists.'
Say ' Last =3D Last frame being rendered'
Say ' First =3D Actual number of first frame'
Say ' Incr =3D Frame number increment'
Say ''
Say ' * If First or Incr is omitted, then 1 is used.'
Say ' * Use Control-C to abort.'
Say ' * Example: RX LW2VLM ram:pic. MyScene 70 31 2'
Say ' The LightWave scene has 70 frames, the first frame to'
Say ' be rendered is PIC.31, and frames will be incremented'
Say ' by 2. The frames will be imported into scene named MyScene=
'
Return
OpenLog:
If ~Open('logfile', LogFN, 'A') then do
If ~Open('logfile', LogFN, 'W') then do
Say 'Error opening log file!'
Exit
End
End
Return
Break_C:
Say 'Control-C detected...'
Say 'Line' SIGL 'RC=3D'RC
Exit
/*
History:
1.0.0 First version
*/